﻿@model ProductListVM
@{
    ViewBag.Title = "Product";
    int i = 0;
}


<aside class="rightcol rightcol-product">
    <h3>Products</h3>
    <nav>
        <ul>
            @foreach (var item in Model.Categories)
            {
                <li><a href="@Url.Action("Index",new {categoryId = item.Id })" class="@(Model.CategoryId == item.Id ? "active" :"")"><i class="iconfont icon-dot"></i>@item.Title</a></li>
            }          
        </ul>
    </nav>
</aside>


<main class="page-about page-product">
    <div class="container-fluid">
       
        @foreach (var item in Model.Products)
        {
            if (i % 2 == 0)
            {
                <div class="row">
                    <div class="col-sm-6">
                        <div class="thumb">
                            <img src="@item.Thumbnail" alt="@item.ProductNo" />
                        </div>
                    </div>
                    <div class="col-sm-6">
                        <div class="des">
                            <h2>@item.ProductName @item.ProductNo</h2>
                            <p>@item.Description</p>
                            <a href="@Url.Action("Detail",new { id = item.Id})" class="more">Products details+</a>
                        </div>
                    </div>
                </div>
            }
            else
            {
                <div class="row">
                    <div class="col-sm-6 col-sm-push-6">
                        <div class="thumb">
                            <img src="@item.Thumbnail" alt="@item.ProductNo" />
                        </div>
                    </div>
                    <div class="col-sm-6 col-sm-pull-6">
                        <div class="des">
                            <h2>@item.ProductName @item.ProductNo</h2>
                            <p>@item.Description</p>
                            <a href="@Url.Action("Detail",new { id = item.Id})" class="more">Products details+</a>
                        </div>
                    </div>
                </div>
            }

            i++;
        }
    </div>
</main>


@*<footer class="container">
    <div class="row">
        <div class="col-sm-7">
            @Html.PagedListPager((IPagedList)Model.Products, page => Url.Action("Index", new { page,  categoryId = Model.CategoryId }))
        </div>
        <div class="col-sm-5">
            <div class="text-right form-inline hidden">
                总计 @Model.TotalCount 条
            </div>
        </div>
    </div>
</footer>*@

